﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ListenMusic.User_Song_ServiceReference;
using System.ServiceModel;
using System.IO;
namespace ListenMusic.Models.Reposistory.User
{
  
    public class UploadResposistory
    {       
        public bool uploadSong(Song s)
        {
            SongServiceClient uSongClient = new SongServiceClient();
            try
            {              
                uSongClient.ClientCredentials.UserName.UserName = "ClientUser";
                uSongClient.ClientCredentials.UserName.Password = "123456";
                return uSongClient.UploadSong(s);
               
            }
            catch (FaultException ex)
            {
                return false;
                throw ex;
            }
        }
        public string RandomStr()
        {
            string str = Path.GetRandomFileName();
            str = str.Replace(".", "");
            return str;

        }
    }
}